package jpaperwork.example.customer;

import jpaperwork.descriptor.*;
import jpaperwork.descriptor.bean.StringListSelection;

import java.util.ArrayList;
import java.util.List;

/**
 * User: fleipold
 * Date: May 6, 2009
 * Time: 6:53:39 PM
 */
public class Customer {

    @StringListSelection(options={"Mrs.","Ms.","Mr."})
    String title;

    public String name;

    @EmbedForm
    public Address address;


    @EmbedForm
    public List<Phone> phones = new ArrayList<Phone>();


    public static Customer createTestCustomer() {
        Customer customer = new Customer();
        customer.name= "Felix";
        customer.title= "Mr.";
        Address address = new Address();
        address.street = "Mayton St";
        address.town = "London";

        customer.address = address;

        Phone phone = new Phone();
        phone.areaCode= "6257";
        phone.number = "432";

        customer.phones.add(phone);

        phone = new Phone();
        phone.areaCode = "6258";
        phone.number = "433";

        customer.phones.add(phone);
        return customer;
    }
}
